package com.sunmouse.toollib.db;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by sunmo on 2017/2/28.
 */
public class MediaBean implements Parcelable {
    /**
     * length=12
     */
    private String mediaId;
    private String cateId;
    private String cateName;
    private String title;
    private String image;
    private String fileName;
    private int fileType;
    private String duration;
    private int isDownloaded;

    public String getMediaId() {
        return mediaId;
    }

    public void setMediaId(String mediaId) {
        this.mediaId = mediaId;
    }

    public String getCateId() {
        return cateId;
    }

    public void setCateId(String cateId) {
        this.cateId = cateId;
    }

    public String getCateName() {
        return cateName;
    }

    public void setCateName(String cateName) {
        this.cateName = cateName;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public int getFileType() {
        return fileType;
    }

    public void setFileType(int fileType) {
        this.fileType = fileType;
    }

    public String getDuration() {
        return duration;
    }

    public void setDuration(String duration) {
        this.duration = duration;
    }

    public int getLoadStatus() {
        return isDownloaded;
    }

    public void setIsDownloaded(int isDownloaded) {
        this.isDownloaded = isDownloaded;
    }

    public String getLocalPath() {
        return localPath;
    }

    public void setLocalPath(String localPath) {
        this.localPath = localPath;
    }

    public String getLastPlay() {
        return lastPlay;
    }

    public void setLastPlay(String lastPlay) {
        this.lastPlay = lastPlay;
    }

    public String getLastPlayDuration() {
        return lastPlayDuration;
    }

    public void setLastPlayDuration(String lastPlayDuration) {
        this.lastPlayDuration = lastPlayDuration;
    }

    private String localPath;
    private String lastPlay;
    private String lastPlayDuration;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.mediaId);
        dest.writeString(this.cateId);
        dest.writeString(this.cateName);
        dest.writeString(this.title);
        dest.writeString(this.image);
        dest.writeString(this.fileName);
        dest.writeInt(this.fileType);
        dest.writeString(this.duration);
        dest.writeInt(this.isDownloaded);
        dest.writeString(this.localPath);
        dest.writeString(this.lastPlay);
        dest.writeString(this.lastPlayDuration);
    }

    public MediaBean() {
    }

    protected MediaBean(Parcel in) {
        this.mediaId = in.readString();
        this.cateId = in.readString();
        this.cateName = in.readString();
        this.title = in.readString();
        this.image = in.readString();
        this.fileName = in.readString();
        this.fileType = in.readInt();
        this.duration = in.readString();
        this.isDownloaded = in.readInt();
        this.localPath = in.readString();
        this.lastPlay = in.readString();
        this.lastPlayDuration = in.readString();
    }

    public static final Creator<MediaBean> CREATOR = new Creator<MediaBean>() {
        @Override
        public MediaBean createFromParcel(Parcel source) {
            return new MediaBean(source);
        }

        @Override
        public MediaBean[] newArray(int size) {
            return new MediaBean[size];
        }
    };
}
